package com.sl.au.service.impl;

import java.util.Date;
import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.EXDEgetPayBackTypeAreaPerson;
import com.sl.au.repository.EXDEpayHistoyRepository;
import com.sl.au.service.EXDEAgingLedgerAddOrReduceService;
import com.sl.au.service.EXDEgetPayBackTypeAreaPersionService;
@Service("EXDEgetPayBackTypeAreaPersionService")
@Transactional
public class EXDEgetPayBackTypeAreaServicePersionImpl extends BaseServiceImpl implements EXDEgetPayBackTypeAreaPersionService{
	@PersistenceContext
	private EntityManager em;
	@Override
	public List<EXDEgetPayBackTypeAreaPerson> getPayDevice(String beginDate, String endDate, String dept) {
		// TODO Auto-generated method stub
		System.out.println(beginDate+","+endDate+","+dept);
		Query query = this.em.createNativeQuery("{call getPayBackTypeAreaPerson(?,?,?)}",EXDEgetPayBackTypeAreaPerson.class);
		query.setParameter(1, beginDate);
		query.setParameter(2, endDate);
		query.setParameter(3, dept);
		
		@SuppressWarnings("unchecked")
		List<EXDEgetPayBackTypeAreaPerson> users = query.getResultList();
		return users;
	}
	

}
